package com.gc.server.vo.down;


import lombok.Data;

import java.util.Date;

import com.alibaba.excel.annotation.*;

import java.io.Serializable;


import java.math.BigDecimal;

import com.gc.server.entity.LinkGoodsEntity;
import com.gc.server.vo.LinkGoodsVo;


/**
 * 连锁产品实体
 * 表名 link_goods
 *
 * @author hxf
 * @email 505860922@qq.com
 * @date Thu Oct 22 18:48:05 CST 2020
 */
@Data
public class LinkGoodsDown implements Serializable {
    @ExcelIgnore
    private static final long serialVersionUID = 1L;

    //
    @ExcelProperty("")
    private Long id;

    //总部ID
    @ExcelProperty("总部ID")
    private Long headId;

    //总部ID
    @ExcelProperty("总部编号")
    private String headCode;

    //总部ID
    @ExcelProperty("总部名称")
    private String headName;

    //产品名称
    @ExcelProperty("产品简称")
    private String name;

    //品牌
    @ExcelProperty("品牌")
    private String brand;

    //产品简称
    @ExcelProperty("产品名称")
    private String nick;

    //编号
    @ExcelProperty("编号")
    private String code;

    //规格
    @ExcelProperty("规格")
    private String spec;

    //型号
    @ExcelProperty("型号")
    private String type;

    //批准文号
    @ExcelProperty("批准文号")
    private String approvalNumber;

    //生产文号
    @ExcelProperty("生产文号")
    private String makeNumber;

    //零售价
    @ExcelProperty("零售价")
    private BigDecimal price;

    //零售价
    @ExcelProperty("积分")
    private BigDecimal point;

    //零售价
    @ExcelProperty("兑费")
    private BigDecimal money;

    //备注
    @ExcelProperty("备注")
    private String remark;

    @ExcelProperty("创建时间")
    private Date date;


    public LinkGoodsDown() {

    }

    public LinkGoodsDown(LinkGoodsVo vo) {
        LinkGoodsEntity entity = vo.getEntity();
        this.setId(entity.getId());

        this.setDate(entity.getDate());

        this.setHeadId(entity.getHeadId());

        if(vo.getHead()!=null){
            this.setHeadCode(vo.getHead().getCode());
            this.setHeadName(vo.getHead().getName());
        }

        this.setName(entity.getName());

        this.setBrand(entity.getBrand());


        this.setNick(entity.getNick());

        this.setCode(entity.getCode());

        this.setSpec(entity.getSpec());

        this.setType(entity.getType());

        this.setApprovalNumber(entity.getApprovalNumber());

        this.setMakeNumber(entity.getMakeNumber());

        this.setPrice(entity.getPrice());

        this.setPoint(entity.getPoint());

        this.setMoney(entity.getMoney());

        this.setRemark(entity.getRemark());

    }


}
